home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / batch / strings2.zip / PARSE.BAT < prev    next >
DOS Batch File  |  1992-11-05  |  763b  |  33 lines

  1. @ECHO off
  2. REM ===================================================================
  3. REM
  4. REM PARSE.BAT - A batch file that parses a filename.
  5. REM
  6. REM Entry: %1 is the filename entered by the user
  7. REM  %2 is the default filename extension desired.
  8. REM
  9. REM Exit:  %FNAME% contains the parsed filename
  10. REM
  11. REM ===================================================================
  12.  
  13. SET fname=%1
  14. SET fext=%2
  15.  
  16. IF .%1==. STRINGS fname = ASK Please enter the name of the file
  17.  
  18. STRINGS fname = FILENAME %fname%
  19.  
  20. IF .%2==. STRINGS fext = ASK Please enter the extension of the file
  21.  
  22. STRINGS fname = FILENAME %FNAME%
  23.  
  24. SET fname=%FNAME%.%FEXT%
  25. IF EXIST %FNAME% GOTO END
  26.  
  27. ECHO The filename %FNAME% does not exist.
  28. SET fname=
  29. GOTO end
  30.  
  31. :END
  32. SET fext=
  33.